It is generally known that a measuring device, an optical sensor for example, may be attached to a glass pane, in particular to the glass pane of a motor vehicle, the windshield for example. However, various external influences affect the measuring function during operation. These include, for example, dust accumulation, condensation on the glass surface, i.e., the surface of the measuring device, after a temperature change in a detrimental climate, the deposit of gas released by plastics, or the exposure to everyday gases, such as cigarette smoke.